home *** CD-ROM | disk | FTP | other *** search
- <?xml version="1.0" encoding="utf-8" ?>
- <!DOCTYPE stack PUBLIC "-//Apple, Inc.//DTD stack V 2.0//EN" "" >
- <stack>
- <name>in</name>
- <id>-1</id>
- <cardCount>3</cardCount>
- <cardID>16517</cardID>
- <listID>2879</listID>
- <cantModify><false /></cantModify>
- <cantDelete><false /></cantDelete>
- <cantAbort><false /></cantAbort>
- <cardSize>
- <width>512</width>
- <height>342</height>
- </cardSize>
- <script>on zapem
- go to second card of bkgnd "Article"
- repeat 46
- domenu delete card
- end repeat
- end zapem
-
- on getLine fileName
- global theLine
- read from file fileName until return
- if it is empty then
- put "**********" into theLine
- else
- delete last char of it
- put it into theLine
- end if
- put theLine into msg
- end getLine
- on import
- global theLine
- ask "Please enter name of text file:"
- if it is empty then exit import
- put it into fileName
- open file fileName
- repeat
- getLine fileName
- if theLine contains "**********" then exit import
- if theLine is "Copyright" then exit repeat
- end repeat
- go to last card
- repeat
- doMenu New Card
- -- Snarf source and dateline.
- getLine fileName
- put theLine into bkgnd field "theSource"
- getLine fileName
- put theLine into bkgnd field "theDate"
- -- Make sure we're still in sync!
- getLine fileName
- if length (theLine) > 1 then
- beep
- put "Bad line after date:" && theLine into msg
- close file fileName
- exit import
- end if
- -- Copy in title. Ending line may be empty or tab.
- repeat
- getLine fileName
- if length(theLine) < 2 then exit repeat
- if last char of theLine is not space then put space after theLine
- put theLine after bkgnd field "theTitle"
- end repeat
- -- Copy in text lines til end of article or file
- put empty into thisText
- repeat
- getLine fileName
- if theLine is "Copyright" then exit repeat
- if char 1 to 10 of theLine is "**********" then
- put thisText into bkgnd field "theText"
- close file fileName
- exit import
- end if
- if theLine is empty then
- put return & return after thisText
- else
- if char 1 to 3 of theLine is " " and thisText is not empty¬
- then put return after thisText
- if last char of theLine is not space then put space after theLine
- put theLine after thisText
- end if
- end repeat
- put thisText into bkgnd field "theText"
- -- update table of contents
- get the id of this card
- put it & return after bkgnd field "IDs" of card "Contents"
- put bkgnd field "theTitle" into thisTitle
- if thisTitle is empty then
- put bkgnd field "theSource" & " — <untitled>" into thisTitle
- end if
- if length(thisTitle) > 60 then put char 1 to 60 of thisTitle into thisTitle
- put thisTitle & return after bkgnd field "Contents" of card "Contents"
- end repeat
- go to card "Contents"
- put the date into bkgnd field "lastDate"
- put the time into bkgnd field "lastTime"
- end import</script>
- <background id="2280" file="background_2280.xml" name="" />
- <background id="3126" file="background_3126.xml" name="Article" />
- <background id="16241" file="background_16241.xml" name="" />
- <card id="16517" file="card_16517.xml" marked="false" name="Contents" owner="16241" />
- <card id="4192" file="card_4192.xml" marked="false" name="About WELL" owner="2280" />
- <card id="3464" file="card_3464.xml" marked="false" name="" owner="3126" />
- </stack>
-